export function getOption1() {
  return {
    color: ["#61a5e8", "#7ecf51", "#eecb5f", "#e3935d"],
    legend: {
      data: ["种植", "仓储", "加工", "流通"],
      bottom: 5
    },
    tooltip: {},
    xAxis: { type: "category", data: ["1月", "2月", "3月", "4月"] },
    yAxis: { type: "value" },
    grid: {
      bottom: "30",
      top: 10,
      left: 10,
      containLabel: true
    },
    series: [
      {
        type: "bar",
        name: "种植",
        barWidth: 20,
        data: [43.3, 85.8, 93.7, 93.7]
      },
      {
        type: "bar",
        name: "仓储",
        barWidth: 20,
        data: [83.1, 73.4, 85.8, 55.1]
      },
      {
        type: "bar",
        name: "加工",
        barWidth: 20,
        data: [86.4, 85.8, 65.2, 82.5]
      },
      {
        type: "bar",
        name: "流通",
        barWidth: 20,
        data: [72.4, 53.9, 85.8, 39.1]
      }
    ]
  };
}
export function getOption2_1() {
  return {
    color: ["#61a5e8", "#7ecf51", "#eecb5f", "#e3935d"],
    tooltip: {
      trigger: "item",
      formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    series: [
      {
        name: "投入品统计",
        type: "pie",
        roseType: "radius",
        data: [
          { value: 20, name: "除虫剂" },
          { value: 35, name: "农家肥" },
          { value: 30, name: "有机肥" },
          { value: 40, name: "尿素" }
        ]
      }
    ]
  };
}
export function getOption2_2() {
  var labelTop = {
    normal: {
      label: {
        show: true,
        position: "center",
        formatter: "{b}",
        textStyle: {
          baseline: "top",
          fontSize: 16,
          color: "#999"
        }
      }
    }
  };
  var labelFromatter = {
    normal: {
      label: {
        formatter: function(params) {
          if (params.dataIndex == 0 ) return 100 - params.value + "%";
        },
         position: "center",
        textStyle: {
          baseline: "center",
          fontSize: 16,
          color: "#000"
        }
      }
    }
  };
  var labelBottom = {
    normal: {
      color: "#dedede",
      label: {
        show: true,
        position: "bottom"
      },
      labelLine: {
        show: false
      }
    }
  };
  var radius = [45, 65];
  return {
    color: ["#61a5e8", "#7ecf51", "#eecb5f", "#e3935d"],
    series: [
      {
        type: "pie",
        center: ["20%", "50%"],
        radius: radius,
        itemStyle: labelFromatter,
        data: [
          { name: "other", value: 86, itemStyle: labelBottom },
          { name: "种植", value: 14, itemStyle: labelTop }
        ]
      },
      {
        type: "pie",
        center: ["50%", "50%"],
        radius: radius,
        itemStyle: labelFromatter,
        data: [
          { name: "other", value: 89, itemStyle: labelBottom },
          { name: "仓储", value: 11, itemStyle: labelTop }
        ]
      },
      {
        type: "pie",
        center: ["80%", "50%"],
        radius: radius,
        itemStyle: labelFromatter,
        data: [
          { name: "other", value: 73, itemStyle: labelBottom },
          { name: "加工", value: 27, itemStyle: labelTop }
        ]
      }
    ]
  };
}
export function getOption2_3() {
  return {
    tooltip: {
      trigger: "item",
      formatter: "{a} <br/>{b} : {c}%"
    },
    color: ["#61a5e8", "#7ecf51", "#eecb5f", "#e3935d"],
    legend: {
      data: ["南梗46", "南梗47", "南梗48", "南梗49"],
      bottom: 5
    },
    calculable: true,
    series: [
      {
        name: "漏斗图",
        type: "funnel",
        left: "10%",
        top: 10,
        bottom: 30,
        width: "80%",
        min: 0,
        max: 100,
        minSize: "0%",
        maxSize: "100%",
        sort: "descending",
        gap: 2,
        label: {
          show: true,
          position: "inside"
        },
        labelLine: {
          length: 10,
          lineStyle: {
            width: 1,
            type: "solid"
          }
        },
        itemStyle: {
          borderColor: "#fff",
          borderWidth: 1
        },
        emphasis: {
          label: {
            fontSize: 20
          }
        },
        data: [
          { value: 60, name: "南梗46" },
          { value: 40, name: "南梗47" },
          { value: 20, name: "南梗48" },
          { value: 80, name: "南梗49" }
        ]
      }
    ]
  };
}
export function getOption3_1() {
  return {
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow"
      }
    },
    color: ["#61a5e8"],
    grid: {
      top: 10,
      left: 10,
      containLabel: true
    },
    xAxis: {
      type: "value"
    },
    yAxis: {
      type: "category",
      data: ["张三", "李四", "王五", "赵六"]
    },
    series: [
      {
        type: "bar",
        barWidth: 25,
        data: [18203, 23489, 29034, 10497]
      }
    ]
  };
}
export function getOption3_2() {
  return {
    color: ["#61a5e8"],
    tooltip: {
      trigger: "axis",
      axisPointer: {
        type: "shadow"
      }
    },
    grid: {
      top: 10,
      left: 0,
      containLabel: true
    },
    xAxis: {
      type: "category",
      data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
    },
    yAxis: {
      type: "value"
    },
    series: [
      {
        data: [820, 932, 901, 934, 1290, 1330, 1320],
        type: "line",
            areaStyle: {},
        smooth: true
      }
    ]
  };
}
export function getOption4 () {
  return {
    color: ["#61a5e8", "#7ecf51", "#eecb5f", "#e3935d"],
    tooltip: {
      trigger: "item",
      formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    series: [
      {
        name: "数量",
        type: "pie",
        radius: [70, 95],
        avoidLabelOverlap: false,
        label: {
          normal: {
            show: false,
            position: "center"
          },
          emphasis: {
            show: true,
            textStyle: {
              fontSize: "30",
              fontWeight: "bold"
            }
          }
        },
        labelLine: {
          normal: {
            show: false
          }
        },
        data: [
          { value: 335, name: "京东" },
          { value: 310, name: "苏宁" },
          { value: 234, name: "田园" },
          { value: 135, name: "供销社" }
        ]
      }
    ]
  };
}
